; Nahida

; Constants -------------------------

; Overrides -------------------------

[TextureOverrideNahidaPosition]
hash = 37ef15ec
vb0 = ResourceNahidaPosition

[TextureOverrideNahidaBlend]
hash = bb58c686
vb1 = ResourceNahidaBlend
handling = skip
draw = 117752,0 

[TextureOverrideNahidaTexcoord]
hash = f7b7ce48
vb1 = ResourceNahidaTexcoord

[TextureOverrideNahidaVertexLimitRaise]
hash = 67d2cdf0

[TextureOverrideNahidaIB]
hash = 8b268d05
handling = skip
drawindexed = auto

[TextureOverrideNahidaHead]
hash = 8b268d05
match_first_index = 0
ib = ResourceNahidaHeadIB
ps-t0 = ResourceNahidaHeadNormalMap
ps-t1 = ResourceNahidaHeadDiffuse
ps-t2 = ResourceNahidaHeadLightMap

$CharacterIB = 1
ResourceRefHeadDiffuse = reference ps-t1

[TextureOverrideNahidaBody]
hash = 8b268d05
match_first_index = 31143
ib = ResourceNahidaBodyIB
ps-t0 = ResourceNahidaBodyNormalMap
ps-t1 = ResourceNahidaBodyDiffuse
ps-t2 = ResourceNahidaBodyLightMap

$CharacterIB = 2
ResourceRefBodyDiffuse = reference ps-t1

[TextureOverrideNahidaDress]
hash = 8b268d05
match_first_index = 71187
ib = null
ps-t0 = ResourceNahidaDressNormalMap
ps-t1 = ResourceNahidaDressDiffuse
ps-t2 = ResourceNahidaDressLightMap

$CharacterIB = 3
ResourceRefDressDiffuse = reference ps-t1

[TextureOverrideNahidaExtra]
hash = 8b268d05
match_first_index = 76875
ib = null
ps-t0 = ResourceNahidaExtraNormalMap
ps-t1 = ResourceNahidaExtraDiffuse
ps-t2 = ResourceNahidaExtraLightMap

$CharacterIB = 4
ResourceRefExtraDiffuse = reference ps-t1

[TextureOverrideNahidaFaceHeadDiffuse]
hash = 895cd4d0
ps-t0 = ResourceNahidaFaceHeadDiffuse


; CommandList -----------------------

; Resources -------------------------

[ResourceNahidaPosition]
type = Buffer
stride = 40
filename = NahidaPosition.buf

[ResourceNahidaBlend]
type = Buffer
stride = 32
filename = NahidaBlend.buf

[ResourceNahidaTexcoord]
type = Buffer
stride = 20
filename = NahidaTexcoord.buf

[ResourceNahidaHeadIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = NahidaHead.ib

[ResourceNahidaBodyIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = NahidaBody.ib

[ResourceNahidaDressIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = NahidaDress.ib

[ResourceNahidaExtraIB]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = NahidaExtra.ib

[ResourceNahidaHeadNormalMap]
filename = NahidaHeadNormalMap.dds

[ResourceNahidaHeadDiffuse]
filename = NahidaHeadDiffuse.dds

[ResourceNahidaHeadLightMap]
filename = NahidaHeadLightMap.dds

[ResourceNahidaBodyNormalMap]
filename = NahidaBodyNormalMap.dds

[ResourceNahidaBodyDiffuse]
filename = NahidaBodyDiffuse.dds

[ResourceNahidaBodyLightMap]
filename = NahidaBodyLightMap.dds

[ResourceNahidaDressNormalMap]
filename = NahidaDressNormalMap.dds

[ResourceNahidaDressDiffuse]
filename = NahidaDressDiffuse.dds

[ResourceNahidaDressLightMap]
filename = NahidaDressLightMap.dds

[ResourceNahidaExtraNormalMap]
filename = NahidaExtraNormalMap.dds

[ResourceNahidaExtraDiffuse]
filename = NahidaExtraDiffuse.dds

[ResourceNahidaExtraLightMap]
filename = NahidaExtraLightMap.dds

[ResourceNahidaFaceHeadDiffuse]
filename = NahidaFaceHeadDiffuse.dds


; .ini generated by GIMI (Genshin-Impact-Model-Importer)
; If you have any issues or find any bugs, please open a ticket at https://github.com/SilentNightSound/GI-Model-Importer/issues or contact SilentNightSound#7430 on discord

; Version 1.0.0 AGMG Tool Developer Version 3 Shader Fixer


; Generated shader fix for 3.0+ GIMI importer characters. Please contact the tool developers at https://discord.gg/agmg if you have any questions.

; Variables -----------------------

[Constants]
global $CharacterIB
;0=none, 1=head, 2=body, 3=dress, 4=extra, etc.

[Present]
post $CharacterIB = 0

[ResourceRefHeadDiffuse]
;[ResourceRefHeadLightMap]
[ResourceRefBodyDiffuse]
;[ResourceRefBodyLightMap]
[ResourceRefDressDiffuse]
;[ResourceRefDressLightMap]
[ResourceRefExtraDiffuse]
;[ResourceRefExtraLightMap]

; ShaderOverride ---------------------------

[ShaderRegexCharReflection]
shader_model = ps_5_0
run = CommandListReflectionTexture
[ShaderRegexCharReflection.pattern]
mul r\d+\.\w+, r\d+\.\w+,[^.]*\.\w+\n
mad o\d+\.\w+, r\d+\.\w+, cb\d+\[\d+\]\.\w+, r\d+\.\w+\n
mov o\d+\.\w+, l\(\d+\.\d+\)\n

;[ShaderRegexCharOutline]
;shader_model = ps_5_0
;run = CommandListOutline
;[ShaderRegexCharOutline.pattern]
;mov o\d+\.\w+, l\(\d+\)\n
;mov o\d+\.\w+, r\d+\.\w+\n
;mov o\d+\.\w+, l\(\d+\.\d+\)
;broken as of version 4.0

; OPTIONAL: If regex match breaks, use a [ShaderOverride] command matching shader hash for reflection then use "run = CommandListOutline" under the command

; CommandList -------------------------

[CommandListReflectionTexture]
if $CharacterIB != 0
    if $CharacterIB == 1
        ps-t0 = copy ResourceRefHeadDiffuse
    else if $CharacterIB == 2
        ps-t0 = copy ResourceRefBodyDiffuse
    else if $CharacterIB == 3
        ps-t0 = copy ResourceRefDressDiffuse
    else if $CharacterIB == 4
        ps-t0 = copy ResourceRefExtraDiffuse    
    endif
drawindexed=auto
$CharacterIB = 0
endif

;[CommandListOutline]
;if $CharacterIB != 0
;    if $CharacterIB == 1
;        ps-t1 = copy ResourceRefHeadLightMap
;    else if $CharacterIB == 2
;        ps-t1 = copy ResourceRefBodyLightMap
;    else if $CharacterIB == 3
;        ps-t1 = copy ResourceRefDressLightMap
;    else if $CharacterIB == 4
;        ps-t1 = copy ResourceRefExtraLightMap
;    endif
;drawindexed=auto
;$CharacterIB = 0
;endif


; 4.1 Character Fix 
[TextureOverride41FixVertexLimitRaise0]
hash = ee37e2d7